import { reactive, toRefs } from 'vue'
import avatar from '@/assets/logo.png'
import { Toast } from 'vant'

export interface UserInfo {
  avatar: any
  nickname: string
  phone: string
}

export const useUpdateEffect = () => {
  const form = reactive<UserInfo>({
    avatar,
    nickname: '王建国',
    phone: '123456789'
  })

  const handleSubmit = () => {
    Toast('成功')
  }

  return {
    ...toRefs(form),
    handleSubmit
  }
}

